package main

import "fmt"

func main() {
	var intChan = make(chan int, 10)
	for i := 0; i < 10; i++ {
		intChan <- i
	}
	close(intChan)
	for {
		x, ok := <-intChan
		if !ok {
			break
		}
		fmt.Println(x)
	}
}
